package edu.gdkm.test.page130.test1;

public class ChongqinTaxi extends Taxi{
    public ChongqinTaxi() {
        this.startcost=10;
        this.startkilo=3;
        this.price =2;
    }

    @Override
    public double cost(int kilo) {
        if(kilo<this.startkilo){
            return this.startcost;
        }else{
            return this.startcost+(kilo-this.startkilo)*this.price;
        }
    }

}
